package com.bj58.chr.senst.test;

import java.io.File;
import java.util.List;

import org.junit.Test;

import com.google.common.base.Charsets;
import com.google.common.io.Files;

public class SmsCheck {

    @Test
    public void clearlog() {
        try {
            String path = System.getProperty("user.dir");
            File write = new File(path + "/conf/01smsclean.txt");
            List<String> lines = Files.readLines(new File(path + "/conf/sms0501.txt"), Charsets.UTF_8);
            Files.write("".getBytes(), write);
            for (String line : lines) {
                if (line.contains("content")) {
                    String str = line.substring(line.indexOf("content") + 8);
                    Files.append(str + "\n", write, Charsets.UTF_8);
                }
            }
            System.out.println("done");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void checksms() {

    }

}
